package com.zhonghe.active4j.function;

import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.util.HashMap;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.mapping.BoundSql;
import org.apache.ibatis.mapping.MappedStatement;
import org.apache.ibatis.session.Configuration;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;


public class My {

	public static void main(String[] args) {
		InputStream resourceAsStream;
		try {
			Reader reader = Resources.getResourceAsReader("com/zhonghe/active4j/system/service/impl/SysUserMapper.xml");
			SqlSessionFactory build = new SqlSessionFactoryBuilder().build(reader);
			Configuration configuration = build.getConfiguration();
			MappedStatement s = configuration.getMappedStatement("com.zhonghe.active4j.system.dao.SysUserDao.findRolesByUserId");
			BoundSql bSql = s.getBoundSql(new HashMap<>());
			SqlSession openSession = build.openSession();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
